import request from '@/utils/request';

export const lostAndFoundApi = {
    // 创建失物招领物品
    create(data) {
        return request.post('/api/lost-and-found', data);
    },

    // 获取失物招领列表
    list(params) {
        return request.get('/api/lost-and-found', { params });
    },

    // 获取简单列表（不关联用户信息）
    listSimple(params) {
        return request.get('/api/lost-and-found-simple', { params });
    },

    // 获取我的物品
    myItems(params) {
        return request.get('/api/lost-and-found/my', { params });
    },

    // 获取物品详情
    detail(id) {
        return request.get(`/api/lost-and-found/${id}`);
    },

    // 更新物品信息
    update(id, data) {
        return request.put(`/api/lost-and-found/${id}`, data);
    },

    // 删除物品
    delete(id) {
        return request.delete(`/api/lost-and-found/${id}`);
    },

    // 更新物品状态
    updateStatus(id, status) {
        return request.patch(`/api/lost-and-found/${id}/status`, { status });
    }
};